The unary operator-z tests for a null string, while-n or no operator at all returns True if a string is not empty. 单目操作符-z测试null字符串,如果字符串非空-n返回True(或者根本没有操作符)。
In the final example, the value of the HOME variable is tested to see if it is a directory using the-d unary operator. 在最后一个示例中,测试HOME变量的值,用单目操作符-d检查它是不是目录。
For example, the unary increment operator is named as operator++. 举例来说,单目增量运算符命名为operator++。
A UML operation representing a binary operator is named similarly to unary operator, but the symbol is one of the binary operators. 表示双目运算符(binaryoperator)的UML操作的命名方式类似于单目运算符,但符号是双目运算符之一。
Defining this unary "operator" in Scala is slightly tricky, but it's purely a syntactic nit 在Scala中定义这种一元“操作符”需要一点技巧,但这只是语法上的问题而已
The parameter of a unary operator must be the containing type 一元运算符的参数必须是包含类型
The unary-( minus) operator yields the negation of its numeric argument. 一元运算符-(减)对其数值型操作数取负。
This unary/ binary global operator can only have one or two parameters 此一元/二进制全局运算符只能具有一个或两个参数
Unary minus operator applied to unsigned type, result still unsigned 一元负运算符应用于无符号类型,结果仍为无符号类型
A unary operator such as Minus is left as an exercise. 像负号这样的一元运算符就留给读者练习。